Application Binary Interfaces (ABIs) provide interfaces between program modules (e.g., between an application and an operating system) and define different details, such as how functions are called and how exceptions are handled. For exception handling, the ABIs define how an exception is evaluated and how execution can be restored after the exception has been handled. The process of exception handling may include walking the calling stack to identify potential handlers, as well as to restore execution at a point chosen by the handler.
In emulation environments, compiled hybrid binaries offer near native performance and complete interoperability with the platform being emulated. A compiled hybrid binary is mostly indistinguishable from other emulated binaries on its interface, while some code has been replaced with emulation host-native code, compiled directly from source code.
While executing emulated code with compiled hybrid binaries, the call stack may contain frames formatted according to two distinct ABIs, including the ABI of the emulation host and the ABI of the emulation guest. Because the stack may contain frames of different ABIs, conventional exception handling techniques cannot handle exceptions in this environment, such as an exception generated by one frame of one ABI to be handled by a frame of another ABI. Thus, exception handling of the ABI in compiled hybrid binaries cannot be reliably and accurately performed in existing systems.